package com.yuntuzhilian.chapter4.demo4;

/**
 * @author MrWang-shuizhishuiheshui
 * @description 父类宠物类
 *
 * abstract : 抽象
 *
 *
 *      1.修饰类  类无法实例化
 *      2.修饰方法  方法没有方法体 ,
 *              抽象方法(在子类中必须被重写,除非子类也是抽象类)
 *              目的:为了让所有的子类必须具有重写的抽象方法
 */
public abstract class Pet {
    //将共同的属性放到父类中
    private String name;
    private int health;
    private int love;
    //构造
    public Pet() {
    }
    public Pet(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    //将共同的方法放到父类中
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getHealth() {
        return health;
    }
    public void setHealth(int health) {
        this.health = health;
    }
    public int getLove() {
        return love;
    }
    public void setLove(int love) {
        this.love = love;
    }

    public abstract void show();
}
